import os

import peewee_async

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

settings = {
    "secret_key": "ZGGA#Mp4yL4w5CDu",
    "jwt_expire": (7 * 86400000),
    "MEDIA_ROOT": os.path.join(BASE_DIR, "media"),
    "SITE_URL": "http://api.blog.qinjiahu.cn",
    "BASE_ADMIN_URL": "/api/v1",
    "BASE_WEB_URL": "/api/v2",
    "IMAGE_URL": 'http://api.blog.qinjiahu.cn/api/v1/media/images/',
    "page_size": '10',
    "db": {
        "host": "47.96.110.164",
        "user": "root",
        "password": "5211314",
        "name": "tornado_blog_database",
        "port": 3306
    },
    "redis": {
        "host": "127.0.0.1"
    }
}

database = peewee_async.MySQLDatabase(
    database='tornado_blog_database',
    host="47.96.110.164",
    # host="127.0.0.1",
    port=3306,
    user="root",
    password="5211314"
)
